﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class Way_send : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (Page.IsValid == true)
        {
            SqlConnection strcon = Class1.DBconnection();
            strcon.Open();
            string Start=this.Start.Text.ToString();
            string Way=this.Way.Text.ToString();
            string Type=this.Type.Text.ToString();
            string Whither=this.Whither.Text.ToString();
            string Pirce=this.Pirce.Text.ToString();
            string CompanyName=this.CompanyName.Text.ToString();
            string Linkman=this.Linkman.Text.ToString();
            string Tel=this.Tel.Text.ToString();
            string Bewrite = this.Bewrite.Text.ToString();
            string Username = Session["username"].ToString();
            string SendNow=Convert.ToString(DateTime.Now);
            SqlCommand cmd = new SqlCommand("insert into tb_Way (Start,Way,Type,Whither,Pirce,CompanyName,Linkman,Tel,Bewrite,SendNow,username)values('" + Start + "','" + Way + "','" + Type + "','" + Whither + "','" + Pirce + "','" + CompanyName + "','" + Linkman + "','" + Tel + "','" + Bewrite + "','" + SendNow+ "','"+Username+"')", strcon);
            cmd.ExecuteNonQuery();
            strcon.Close();
            Response.Write("<script language=javascript>alert('恭喜您，添加成功！等待审核！')</script>");
        }
    }
}
